﻿<from class="layui-form layui-form-pane" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入标题"
                   class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">描述</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入内容" lay-verify="required" name="content" class="layui-textarea"></textarea>
        </div>
    </div>

    <div class="layui-form-item" style="text-align: center;">
        <button class="layui-btn" lay-submit="" lay-filter="feedback">确认提交</button>
    </div>
</from>
<script type="text/javascript">
    layui.define(['layer', 'form'], function (exports) {
        var form = layui.form;
        var $ = layui.jquery;

        form.on('submit(feedback)', function (data) {
            var index = layer.load(1);
            setTimeout(function () {
                workUtils.ajaxPost('../feedback/add', data.field, function (result) {
                    layer.close(index);
                    layer.msg('反馈已经提交，管理员会及时处理......', {time: 1500});
                    layer.closeAll();
                });
            }, 400);
            return false;
        });
    });
</script>